const Base = require('./base.js');
module.exports = class extends Base {
	async share(userid){
		const qrcode = await this.where({
				user_id: userid
			}).find();
			const url = think.service("url");
			let qrcode_url = await url.create(`/app/wxmp/oauth/qrcode?id=${qrcode.id}`);
			if(think.isEmpty(qrcode)) {
				qrcode_url = await url.create(`/app/wxmp/user/share`);
			}

			return {
				share_url: qrcode_url
			};
	}

	
};